package com.github.catvod.spider.merge;

import java.util.HashMap;
import java.util.Map;

/* loaded from: classes.dex */
public class iP implements Cloneable {
    private static final String[] V0;
    private String Qy;
    private String u;
    private static final Map<String, iP> h = new HashMap();
    private static final String[] j = {"object", "base", "font", "tt", "i", "b", "u", "big", "small", "em", "strong", "dfn", "code", "samp", "kbd", "var", "cite", "abbr", "time", "acronym", "mark", "ruby", "rt", "rp", "a", "img", "br", "wbr", "map", "q", "sub", "sup", "bdo", "iframe", "embed", "span", "input", "select", "textarea", "label", "button", "optgroup", "option", "legend", "datalist", "keygen", "output", "progress", "meter", "area", "param", "source", "track", "summary", "command", "device", "area", "basefont", "bgsound", "menuitem", "param", "source", "track", "data", "bdi", "s"};
    private static final String[] q = {"meta", "link", "base", "frame", "img", "br", "wbr", "embed", "hr", "input", "keygen", "col", "command", "device", "area", "basefont", "bgsound", "menuitem", "param", "source", "track"};
    private static final String[] I = {"title", "a", "p", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "address", "li", "th", "td", "script", "style", "ins", "del", "s"};
    private static final String[] oC = {"pre", "plaintext", "title", "textarea"};
    private static final String[] BQ = {"button", "fieldset", "input", "keygen", "object", "output", "select", "textarea"};
    private static final String[] W = {"input", "keygen", "object", "select", "textarea"};
    private boolean oq = true;
    private boolean F8 = true;
    private boolean t = false;
    private boolean n = false;
    private boolean iU = false;
    private boolean i4 = false;
    private boolean y = false;

    static {
        String[] strArr = {"html", "head", "body", "frameset", "script", "noscript", "style", "meta", "link", "title", "frame", "noframes", "section", "nav", "aside", "hgroup", "header", "footer", "p", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "pre", "div", "blockquote", "hr", "address", "figure", "figcaption", "form", "fieldset", "ins", "del", "dl", "dt", "dd", "li", "table", "caption", "thead", "tfoot", "tbody", "colgroup", "col", "tr", "th", "td", "video", "audio", "canvas", "details", "menu", "plaintext", "template", "article", "main", "svg", "math", "center"};
        V0 = strArr;
        for (String str : strArr) {
            F8(new iP(str));
        }
        for (String str2 : j) {
            iP iPVar = new iP(str2);
            iPVar.oq = false;
            iPVar.F8 = false;
            F8(iPVar);
        }
        for (String str3 : q) {
            iP iPVar2 = h.get(str3);
            R2.u(iPVar2);
            iPVar2.t = true;
        }
        for (String str4 : I) {
            iP iPVar3 = h.get(str4);
            R2.u(iPVar3);
            iPVar3.F8 = false;
        }
        for (String str5 : oC) {
            iP iPVar4 = h.get(str5);
            R2.u(iPVar4);
            iPVar4.iU = true;
        }
        for (String str6 : BQ) {
            iP iPVar5 = h.get(str6);
            R2.u(iPVar5);
            iPVar5.i4 = true;
        }
        for (String str7 : W) {
            iP iPVar6 = h.get(str7);
            R2.u(iPVar6);
            iPVar6.y = true;
        }
    }

    private iP(String str) {
        this.u = str;
        this.Qy = AR.h(str);
    }

    private static void F8(iP iPVar) {
        h.put(iPVar.u, iPVar);
    }

    public static iP iU(String str, Qg qg) {
        R2.u(str);
        Map<String, iP> map = h;
        iP iPVar = map.get(str);
        if (iPVar != null) {
            return iPVar;
        }
        String j2 = qg.j(str);
        R2.BQ(j2);
        String h2 = AR.h(j2);
        iP iPVar2 = map.get(h2);
        if (iPVar2 == null) {
            iP iPVar3 = new iP(j2);
            iPVar3.oq = false;
            return iPVar3;
        }
        if (!qg.I() || j2.equals(h2)) {
            return iPVar2;
        }
        iP clone = iPVar2.clone();
        clone.u = j2;
        return clone;
    }

    public static iP n(String str) {
        return iU(str, Qg.V0);
    }

    public boolean BQ() {
        return !this.oq;
    }

    public boolean I() {
        return this.t;
    }

    public String Qy() {
        return this.Qy;
    }

    public boolean V0() {
        return this.F8;
    }

    public boolean W() {
        return h.containsKey(this.u);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof iP)) {
            return false;
        }
        iP iPVar = (iP) obj;
        return this.u.equals(iPVar.u) && this.t == iPVar.t && this.F8 == iPVar.F8 && this.oq == iPVar.oq && this.iU == iPVar.iU && this.n == iPVar.n && this.i4 == iPVar.i4 && this.y == iPVar.y;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    /* renamed from: h, reason: merged with bridge method [inline-methods] */
    public iP clone() {
        try {
            return (iP) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }

    public int hashCode() {
        return (((((((((((((this.u.hashCode() * 31) + (this.oq ? 1 : 0)) * 31) + (this.F8 ? 1 : 0)) * 31) + (this.t ? 1 : 0)) * 31) + (this.n ? 1 : 0)) * 31) + (this.iU ? 1 : 0)) * 31) + (this.i4 ? 1 : 0)) * 31) + (this.y ? 1 : 0);
    }

    public String j() {
        return this.u;
    }

    public boolean oC() {
        return this.i4;
    }

    public boolean oq() {
        return this.iU;
    }

    public boolean q() {
        return this.oq;
    }

    iP t() {
        this.n = true;
        return this;
    }

    public String toString() {
        return this.u;
    }

    public boolean u() {
        return this.t || this.n;
    }
}
